package il.ac.bgu.soa2009.hw5.restuarnt;

import il.ac.bgu.soa2009.hw5.schema.OpenHour;
import il.ac.bgu.soa2009.hw5.schema.TableReservation;

public class ToStringUtils {
    public static String toString(OpenHour openHour) {
        return "day " + openHour.getWeekDay().getValue() + ",from hour " + openHour.getFrom().getValue() + ", to hour " + openHour.getTo();
    }

    public static String toString(OpenHour[] openHours) {
        String res = "";
        if (openHours != null) {
            for (OpenHour openHour : openHours) {
                res = res + toString(openHour) + "\n";
            }
        } else {
            res = "empty openning hours";
        }
        return res;
    }

    public static String toString(TableReservation reservation) {
        return reservation.getCostumerName().getName() + "," + new MyDate(reservation.getDate()) + ", time " + reservation.getTime() + ":00";
    }
}
